package com.ehcache.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.CacheManager;
import org.springframework.stereotype.Service;

import com.ehcache.entity.UserEntity;
import com.ehcache.mapper.UserMapper;

@Service
public class UserService {
	@Autowired
	private UserMapper userMapper;
	@Autowired
	private CacheManager cacheManager;

	public UserEntity selectUserById(long id){
		return userMapper.selectById(id);
	}
	public void remoKey() {
		cacheManager.getCache("userCache").clear();
	}

}
